import {ADD_PERSON} from "../constent";

const initData=[{id:'001',name:'liming',age:'18'}]

export default function personReducer(preState=initData,action){
    const {type,data} = action
    switch (type){
        case ADD_PERSON:
            return [data,...preState]
        default:
            return preState
    }
}